package moe.fuqiuluo.api

import com.tencent.mobileqq.channel.ChannelManager
import moe.fuqiuluo.ext.hex2ByteArray
import com.shr25.robot.protocol.UnidbgFetchQsign

suspend fun submit(uin: Long, cmd: String, callbackId: Long, buffer: ByteArray) {
    UnidbgFetchQsign.logger.debug("Bot(${uin}) submit ${cmd}")
    val session = findSession(uin)
    session.withLock {
        ChannelManager.onNativeReceive(session.vm, cmd, buffer, callbackId)
        session.vm.global["HAS_SUBMIT"] = true
    }
}